module.exports = {
  // configureWebpack: {
  //   plugins: [
  //     new webpack.DefinePlugin({
  //       "process.env": {
  //         NODE_ENV: JSON.stringify(process.env.NODE_ENV),
  //         VUE_APP_FACE_PATH: JSON.stringify(process.env.VUE_APP_FACE_PATH),
  //       },
  //     }),
  //   ],
  // },
  css: {
    loaderOptions: {
      scss: {
        additionalData: `@import "~@/assets/styles/theme.scss";@import "~@/assets/styles/v-im.scss";`,
      },
    },
  },
  pluginOptions: {
    electronBuilder: {
      nodeIntegration: true,
      builderOptions: {
        appId: "https://gitee.com/lele-666/V-IM",
        productName: "客服聊天工具", //项目名，也是生成的安装文件名，即aDemo.exe
        copyright: "Copyright © 2020 ys", //版权信息
        directories: {
          output: "./dist_electron", //输出文件路径
        },
        win: {
          //win相关配置
          icon: "public/favicon.ico",
          target: [
            {
              target: "nsis",
              arch: ["x64"],
            },
          ],
        },
      },
    },
  },
  devServer: {
    port: 8888,
    host: "localhost",
    proxy: {
      "/dev-api": {
        target: "http://172.16.0.84:8202/",
        // target: "http://bonatonesh3.natapp1.cc/",
        // target: "http://127.0.0.1:8202/",
        changeOrigin: true,
        pathRewrite: {
          "^/dev-api": "",
        },
      },
      "/vimServer": {
        // target: "http://172.16.3.83:8888",
        target: "http://127.0.0.1:9326/",
        ws: true,
        changeOrigin: true,
        pathRewrite: {
          "^/vimServer": "",
        },
      },
    },
  },
  outputDir: "hannahvim", // 打包后生成的文件夹名称
  publicPath: process.env.NODE_ENV === "production" ? "./" : "/", // 打包后的文件夹名称
};
